package javaTec;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class QuickSort {


    public static void main(String[] args) {
        final int PER_QUERY_SIZE = 2000;
        List<Integer> uids = new ArrayList<>();
       /* for (int i = 0; i < 1; i++) {
            uids.add(i);
        }*/

        int toDealNum = uids.size();
        if (uids.size() != 0) {
            boolean circle = true;
            do {
                if (toDealNum == 0) {
                    break;
                }
                int toIndex = uids.size() - toDealNum + PER_QUERY_SIZE;
                if (toDealNum / PER_QUERY_SIZE == 0 && toDealNum % PER_QUERY_SIZE != 0) {
                    toIndex = uids.size() - toDealNum + toDealNum % PER_QUERY_SIZE;
                    circle = false;
                }
                List<Integer> uidsTemp = new ArrayList<>();
                try {
                    uidsTemp = uids.subList(uids.size() - toDealNum, toIndex);
                } catch (Exception e) {
                    e.printStackTrace();
                }
                System.out.println(uidsTemp.size());
                toDealNum = toDealNum - PER_QUERY_SIZE;
            } while (circle);
        }
    }
}
